//返回头部
(function(){
$(function(){
    $(window).scroll(function(){
        $(".daohang-bottom-b3").click(function(){
            $("html,body").stop().animate({scrollTop:0},1000)
        })
    })
})

//放大镜
//点击事件
var oImg = $(".line5-faj-box .line5-img1")
var oBtn = $(".line5-faj-btn .line5-faj-img2")
var oBig = $(".line5-faj .big-box img")
for (let i = 0; i < oBtn.length; i++) {
    oBtn[i].onclick = function () {
            for (var j = 0; j < oBtn.length; j++) {
                oImg[j].className = i == j ? "l5-active line5-img1" : ""
                oBig[j].className = i == j ? "show" : ""
            }
    }
}


$(function(){
    $(".line5-faj-box").hover(function(){
        $(".big-box").toggle();
        $(".line5-faj-box .middle-box").toggle();
    })
    var sp = $(".line5-faj-box .middle-box").width()
    var sm = $(".line5-faj .line5-faj-box").width()


    $(".line5-faj-box").mousemove(function(e){
        var oX = $(".line5-faj-box").offset().left;
        var oY = $(".line5-faj-box").offset().top;

        var eX= e.pageX
        var eY =e.pageY

        var sx = eX - oX
        var sy = eY - oY 
        

        if (sx<sp/2) {
            sx = sp / 2
        }
        if (sy<sp/2) {
            sy = sp / 2
        }
        if (sx>sm-sp/2) {
            sx = sm - sp/2
        }
        if (sy>sm-sp/2) {
            sy = sm - sp/2 
        }
         $(".line5-faj-box .middle-box").css({
             left:sx-sp/2,
             top:sy-sp/2
         })

  
        $(".line5-faj .big-box img").css({
            left:-sm/sp*(sx-sp/2),

            top:-sm/sp*(sy-sp/2)
        })
    })
})   


})()

    var oSub = document.querySelector(".text5-h1")
    console.log(oSub);
    var oNum = document.querySelector(".text5-h2")
    var oSup = document.querySelector(".text5-h3")
    var oTatol = document.querySelector(".text2-mo3")
    var data = {
        dj:259
    }
    var numb = 1;
    oSup.onclick = function(){
        numb++
        eee()
    }
    
    oSub.onclick = function(){
        if (numb>1) {
            numb--
            eee()
        }
    }
     function eee() {
        oNum.innerHTML = numb
        oTatol.innerHTML = numb * data.dj
    }




    

    
